<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommentsTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('comments',function($table){
			$table->engine = 'InnoDB';
			$table->increments('id');
			//评论内容
			$table->text('content')->default('');
			//评论对象的ID
			$table->integer('comment_id')->default(1);
			//评论类型，1为新闻评论，2为项目评论，3为博文评论
			$table->tinyInteger('comment_type')->default(1);
			//评论用户ID
			$table->integer('user_id')->default(1);
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('comments');
	}

}
